TQueue< T > Class Template Reference
[Template Containers]

Queue template. More...

#include <tqueue.h>

Inheritance diagram for TQueue< T >:
Inheritance graph
[legend]

Public Member Functions

 TQueue ()
 Default queue constructor.
 TQueue (const TQueue< T > &)
 Queue copy constructor.
 ~TQueue ()
 Queue destructor.
TQueue< T > & operator= (const TQueue< T > &)
 Assignment operator.
bool enqueue (const T &)
 Push item into queue.
dequeue ()
 Pop front item from queue.
T & peek () const
 Return copy of front item.

Detailed Description

template<class T>
class Steinberg::TQueue< T >

Queue template.

A queue is a "first in first out" (FIFO) data structure. Elements are added to the back of the queue and may be removed from the front. Queue does not allow iteration through its elements. Only the top item of the queue can be examined.


Constructor & Destructor Documentation

TQueue (  )  [inline]

Default queue constructor.

TQueue ( const TQueue< T > &  queue  )  [inline]

Queue copy constructor.

"TQueue" is the queue copy constructor.

Parameters:
[in] queue : source queue
~TQueue (  )  [inline]

Queue destructor.


Member Function Documentation

TQueue< T > & operator= ( const TQueue< T > &  queue  )  [inline]

Assignment operator.

The operator "=" copies the content of the input queue into this queue.

Parameters:
[in] queue : source queue
Returns:
: copy of the queue

Reimplemented from TLinkedList< T >.

bool enqueue ( const T &  obj  )  [inline]

Push item into queue.

The method "enqueue" adds a new item at the end of the queue.

Parameters:
[in] obj : the new item which will be added to the queue.
Returns:
: true if item is successfully added / false if item is not added
T dequeue (  )  [inline]

Pop front item from queue.

The method "dequeue" removes the top item from the queue.

Returns:
: copy of the removed item
T & peek (  )  const [inline]

Return copy of front item.

The method "peek" returns a copy of the top queue item.

Returns:
: copy of the top queue item
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Empty

Copyright ©2013 Steinberg Media Technologies GmbH. All Rights Reserved.